<template>
  <div class="container">
    <div>
      <Logo />
      <h1 class="title">
        基于nuxt的第1个app - 首页 - {{ userDetailInfo.user_name }}
      </h1>
      <navigation-toolbar :userDetailInfo="userDetailInfo" />

    </div>
  </div>
</template>

<script>
  import {getCertificate} from '@/api/demo'

  export default {
    data() {
      return {
        userDetailInfo: {}
      }
    },
    head: {
      title: '你好 - Nuxt - ' + new Date().constructor(),
      meta: [
        {hid: 'keywords', name: 'keywords', content: 'keyword1,keyword2,keyword3'},
        {hid: 'description', name: 'description', content: 'My custom description'},
      ]
    },
    asyncData({ params }) {
      // console.log(params)
      return getCertificate({id:21964,sign:'318a9ffcc1e9984e8c8f091c18f7103e'}).then(res => {
        // console.log(res.data)
        return { userDetailInfo: res.data }
      }).catch(error => {
        console.log("error", error)
      })
    }
  }
</script>

<style>

</style>
